Hello and welcome to this feat you in this video.
I'm going to illustrate how the concert keyword work cost is a shot from for constant.
It's another way you can use to declare variables rather than use the key word you can use konst to
declare your variables is declared is only a concept.
Key word should not be re assigned.
So each time.
Years of cons key word to create variables they will be variables that you don't expect to reassign.
So I'm going to show the illustration of this.
So I've got inside my text editor here.
I've just added this line of code here so I've created a constant here called birth year and that's
set down to 1980 and then I got a variable called H.
And I've said that to 20 17 miners both here which is this constant constant logging the result.
So inside the console don't lock up passing it the H.
Which is this variable.
Now what that would do it would take away this subtract 1980 from 2017 and it all output the result.
So let me try and save that.
Let's run run the code inside our text editor and see what happens.
So just click takes it refresh.
So you can see here is given me an output of thirty seven.
So the calculation is working as expected.
So fine go ahead and see create not a variable.
So if I come here I create a variable variable.
We divide key word and I'm going to call it birth year as well.
Same as a constant
column.
I am not going to set base to a different year so I make this.
19.
Oh right.
So I said that if I run the code again I expect it not to work because I've already got a constant variable
for that so that should not change.
So here I am to defining it a game here.
So let me run and run the code so you can see how that works.
So fine you can see here get getting errors here because I have reassigned a constant variable so with
constant variables that you are not supposed to read assigned.
Alright so I've already got a valley here for berthier and I've created another one here.
Hence my code is give in an error.
I'm just going to comment not line out and get rid of that now and save that refresh to code the code
shoot let memory back refresh.
You can say is outputting correctly now so we can t key thing to take away.
Here we use constants to declare your variables.
They will be the variables.
You don't expect to change or you don't expect to read a sign.
Right.
So that's it.
Thanks for watching my friend.